class Solution {
    public boolean isPalindrome(int x) {
        if(x<0)
            return false;
        int num = 0;
        int[] a = new int[10];
        while(true)
        {
            if(x==0)
                break;
            if(x<10)
            {
                a[num] = x;
                break;
            }
            a[num] = x%10;
            num++;
            x = x/10;

        }
        int sum = num+1;
        for(int i = 0 ; i < sum/2 ; i++,num--)
        {
            if(a[i]!=a[num])
                return false;
        }
        return true;
    }
}
public class task {
    public static void main(String[] args) {
        Solution s1 = new Solution();
        System.out.println(s1.isPalindrome(151));
    }
}
